<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="applicable-device" content="mobile">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <link rel="Bookmark" href="../imgs/bai.ico"/>
    <link rel="Shortcut Icon" href="../imgs/bai.ico"/>
    <title>家政</title>
    <style type="text/css">
        body { margin: 0; }
        /*首页*/
        #list { padding: 10px 5%; width: 90%; height: 100vh; background: #F9F9F9; }
        #title { font-size: 30px; font-weight: bolder; }
        #thumb { width: 100%; } #thumb img { width: 100%; }
        #price { font-size: 25px; color: #0088cc; }
        #gsprice { text-decoration: line-through; color: #888; }
        #cnt { margin: 10px 0; padding: 10px; color: #888; background: #EEEEEE; }
    </style>
</head>
<body>
    <!--列表-->
    <div id="list">
        <div id="title"></div>
        <div id="thumb"></div>
        <div id="price"></div>
        <div id="gsprice"></div>
        <div id="cnt"></div>
        <div id="cntList"></div>
    </div>

    <span id="msgPop"></span>
</body>
</html>


<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../js/view.js"></script>
<script type="text/javascript">
    var cw = document.documentElement.clientWidth;
    var ch = document.documentElement.clientHeight;
    var fwid = getParamByUrl('id');
    (function () {
        getList();
    })();
    function getList(){
        $.ajax({
            type: apis.fuwuOne.method,
            url: apis.fuwuOne.url,
            data: { id: fwid },
            success: function (res) {
                console.log(res);
                if (res.code != 0) {
                    console.log(res.msg);
                }
                var d = res.data;
                $('#title').html(d.title);
                if (d.thumb != '') {
                    $('#thumb').html('<img src="' + d.prefixUrl + d.thumb + '"/>');
                }
                $('#price').html('参考报价：￥' + d.price);
                $('#gsprice').html('公司报价：￥' + d.gsprice);
                $('#cnt').html(d.cnt);
                var h = '', i, type, cnt;
                for (i = 0; i < d.length; i ++) {
                    type = d[i].type;
                    cnt = d[i].cnt;
                    h += '<div>';
                    if (type == 2) {
                        h += '<img src="' + cnt + '"/>';
                    } else if ( type == 3) {
                    } else {
                        h += cnt;
                    }
                    h += '</div>';
                }
                $('#cntList').html(h);
            },
            error: function () {
                console.log('网络错误');
            }
        });
    }
</script>